.class public Les/je0;
.super Les/ve0;
.source "OBEXClientSessionImpl.java"

# interfaces
.implements Les/sp0;


# instance fields
.field private m:Les/ge0;


# direct methods
.method public constructor <init>(Les/pp0;Les/ke0;)V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Ljava/lang/Error;
        }
    .end annotation

    .line 1
    invoke-direct {p0, p1, p2}, Les/ve0;-><init>(Les/pp0;Les/ke0;)V

    const/4 p1, 0x0

    .line 2
    iput-boolean p1, p0, Les/ve0;->l:Z

    .line 3
    iput-boolean p1, p0, Les/ve0;->a:Z

    const/4 p1, 0x0

    .line 4
    iput-object p1, p0, Les/je0;->m:Les/ge0;

    return-void
.end method

.method private a(Les/tp0;ZZZ)Les/tp0;
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x2

    new-array v1, v0, [B

    const/4 v2, 0x0

    if-eqz p3, :cond_0

    const/4 v0, 0x0

    :cond_0
    or-int/2addr v0, p2

    int-to-byte v0, v0

    aput-byte v0, v1, v2

    const/4 v0, 0x1

    aput-byte v2, v1, v0

    const/16 v3, 0x85

    .line 6
    move-object v4, p1

    check-cast v4, Les/le0;

    invoke-virtual {p0, v3, v1, v4}, Les/ve0;->a(I[BLes/le0;)V

    .line 7
    invoke-virtual {p0}, Les/ve0;->j()[B

    move-result-object v1

    .line 8
    aget-byte v2, v1, v2

    const/4 v3, 0x3

    invoke-static {v2, v1, v3}, Les/le0;->a(B[BI)Les/le0;

    move-result-object v1

    .line 9
    invoke-virtual {p0, v4, v1}, Les/ve0;->b(Les/le0;Les/le0;)V

    if-nez p4, :cond_1

    .line 10
    invoke-virtual {v1}, Les/le0;->b()I

    move-result p4

    const/16 v2, 0xc1

    if-ne p4, v2, :cond_1

    .line 11
    invoke-virtual {v1}, Les/le0;->e()Z

    move-result p4

    if-eqz p4, :cond_1

    .line 12
    invoke-static {p1}, Les/le0;->a(Les/tp0;)Les/le0;

    move-result-object p1

    .line 13
    invoke-virtual {p0, v1, p1}, Les/ve0;->a(Les/le0;Les/le0;)V

    .line 14
    invoke-direct {p0, p1, p2, p3, v0}, Les/je0;->a(Les/tp0;ZZZ)Les/tp0;

    move-result-object p1

    return-object p1

    :cond_1
    return-object v1
.end method

.method private b(Les/tp0;Z)Les/tp0;
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-static {p1}, Les/ve0;->g(Les/tp0;)V

    .line 2
    iget-boolean v0, p0, Les/ve0;->a:Z

    if-nez v0, :cond_7

    const/4 v0, 0x4

    new-array v0, v0, [B

    const/16 v1, 0x10

    const/4 v2, 0x0

    aput-byte v1, v0, v2

    const/4 v1, 0x1

    aput-byte v2, v0, v1

    const/4 v3, 0x2

    .line 3
    iget-object v4, p0, Les/ve0;->h:Les/ke0;

    iget v4, v4, Les/ke0;->c:I

    invoke-static {v4}, Les/xe0;->a(I)B

    move-result v4

    aput-byte v4, v0, v3

    .line 4
    iget-object v3, p0, Les/ve0;->h:Les/ke0;

    iget v3, v3, Les/ke0;->c:I

    invoke-static {v3}, Les/xe0;->b(I)B

    move-result v3

    const/4 v4, 0x3

    aput-byte v3, v0, v4

    const/16 v3, 0x80

    .line 5
    move-object v5, p1

    check-cast v5, Les/le0;

    invoke-virtual {p0, v3, v0, v5}, Les/ve0;->a(I[BLes/le0;)V

    .line 6
    invoke-virtual {p0}, Les/ve0;->j()[B

    move-result-object v0

    .line 7
    array-length v3, v0

    const/4 v6, 0x6

    if-ge v3, v6, :cond_1

    .line 8
    array-length p1, v0

    if-ne p1, v4, :cond_0

    .line 9
    new-instance p1, Ljava/io/IOException;

    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "Invalid response from OBEX server "

    invoke-virtual {p2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    aget-byte v0, v0, v2

    .line 10
    invoke-static {v0}, Les/xe0;->a(B)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 11
    :cond_0
    new-instance p1, Ljava/io/IOException;

    const-string p2, "Invalid response from OBEX server"

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1

    :cond_1
    const/4 v3, 0x5

    .line 12
    aget-byte v3, v0, v3

    aget-byte v4, v0, v6

    invoke-static {v3, v4}, Les/xe0;->a(BB)I

    move-result v3

    const/16 v4, 0xff

    if-lt v3, v4, :cond_6

    .line 13
    iget v4, p0, Les/ve0;->f:I

    if-ge v3, v4, :cond_2

    .line 14
    iput v3, p0, Les/ve0;->f:I

    .line 15
    :cond_2
    iget v3, p0, Les/ve0;->f:I

    int-to-long v3, v3

    const-string v6, "mtu selected"

    invoke-static {v6, v3, v4}, Les/be0;->a(Ljava/lang/String;J)V

    .line 16
    aget-byte v2, v0, v2

    const/4 v3, 0x7

    invoke-static {v2, v0, v3}, Les/le0;->a(B[BI)Les/le0;

    move-result-object v0

    const/16 v2, 0xcb

    .line 17
    invoke-virtual {v0, v2}, Les/le0;->a(I)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_3

    .line 18
    check-cast v2, Ljava/lang/Long;

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    iput-wide v2, p0, Les/ve0;->e:J

    .line 19
    :cond_3
    invoke-virtual {p0, v5, v0}, Les/ve0;->b(Les/le0;Les/le0;)V

    if-nez p2, :cond_4

    .line 20
    invoke-virtual {v0}, Les/le0;->b()I

    move-result p2

    const/16 v2, 0xc1

    if-ne p2, v2, :cond_4

    .line 21
    invoke-virtual {v0}, Les/le0;->e()Z

    move-result p2

    if-eqz p2, :cond_4

    .line 22
    invoke-static {p1}, Les/le0;->a(Les/tp0;)Les/le0;

    move-result-object p1

    .line 23
    invoke-virtual {p0, v0, p1}, Les/ve0;->a(Les/le0;Les/le0;)V

    .line 24
    invoke-direct {p0, p1, v1}, Les/je0;->b(Les/tp0;Z)Les/tp0;

    move-result-object p1

    return-object p1

    .line 25
    :cond_4
    invoke-virtual {v0}, Les/le0;->b()I

    move-result p1

    const/16 p2, 0xa0

    if-ne p1, p2, :cond_5

    .line 26
    iput-boolean v1, p0, Les/ve0;->a:Z

    :cond_5
    return-object v0

    .line 27
    :cond_6
    new-instance p1, Ljava/io/IOException;

    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "Invalid MTU "

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 28
    :cond_7
    new-instance p1, Ljava/io/IOException;

    const-string p2, "Session already connected"

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public static bridge synthetic k()Les/tp0;
    .locals 1

    invoke-static {}, Les/ve0;->k()Les/tp0;

    move-result-object v0

    return-object v0
.end method

.method private m()V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-boolean v0, p0, Les/ve0;->a:Z

    if-eqz v0, :cond_2

    .line 2
    iget-object v0, p0, Les/je0;->m:Les/ge0;

    if-eqz v0, :cond_1

    .line 3
    invoke-virtual {v0}, Les/ge0;->isClosed()Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 4
    iput-object v0, p0, Les/je0;->m:Les/ge0;

    goto :goto_0

    .line 5
    :cond_0
    new-instance v0, Ljava/io/IOException;

    const-string v1, "Client is already in an operation"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    :goto_0
    return-void

    .line 6
    :cond_2
    new-instance v0, Ljava/io/IOException;

    const-string v1, "Session not connected"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0
.end method


# virtual methods
.method public a(Les/tp0;)Les/tp0;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 15
    invoke-static {p1}, Les/ve0;->g(Les/tp0;)V

    .line 16
    invoke-direct {p0}, Les/je0;->m()V

    const/4 v0, 0x0

    .line 17
    invoke-virtual {p0, p1, v0}, Les/je0;->a(Les/tp0;Z)Les/tp0;

    move-result-object p1

    return-object p1
.end method

.method a(Les/tp0;Z)Les/tp0;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 18
    move-object v0, p1

    check-cast v0, Les/le0;

    const/16 v1, 0x82

    invoke-virtual {p0, v1, v0}, Les/ve0;->a(ILes/le0;)V

    .line 19
    invoke-virtual {p0}, Les/ve0;->j()[B

    move-result-object v1

    const/4 v2, 0x0

    .line 20
    aget-byte v2, v1, v2

    const/4 v3, 0x3

    invoke-static {v2, v1, v3}, Les/le0;->a(B[BI)Les/le0;

    move-result-object v1

    .line 21
    invoke-virtual {p0, v0, v1}, Les/ve0;->b(Les/le0;Les/le0;)V

    if-nez p2, :cond_0

    .line 22
    invoke-virtual {v1}, Les/le0;->b()I

    move-result p2

    const/16 v0, 0xc1

    if-ne p2, v0, :cond_0

    .line 23
    invoke-virtual {v1}, Les/le0;->e()Z

    move-result p2

    if-eqz p2, :cond_0

    .line 24
    invoke-static {p1}, Les/le0;->a(Les/tp0;)Les/le0;

    move-result-object p1

    .line 25
    invoke-virtual {p0, v1, p1}, Les/ve0;->a(Les/le0;Les/le0;)V

    const/4 p2, 0x1

    .line 26
    invoke-virtual {p0, p1, p2}, Les/je0;->a(Les/tp0;Z)Les/tp0;

    move-result-object p1

    return-object p1

    :cond_0
    return-object v1
.end method

.method public a(Les/tp0;ZZ)Les/tp0;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 3
    invoke-static {p1}, Les/ve0;->g(Les/tp0;)V

    .line 4
    invoke-direct {p0}, Les/je0;->m()V

    const/4 v0, 0x0

    .line 5
    invoke-direct {p0, p1, p2, p3, v0}, Les/je0;->a(Les/tp0;ZZZ)Les/tp0;

    move-result-object p1

    return-object p1
.end method

.method public a(J)V
    .locals 3

    const-wide/16 v0, 0x0

    cmp-long v2, p1, v0

    if-ltz v2, :cond_0

    const-wide v0, 0xffffffffL

    cmp-long v2, p1, v0

    if-gtz v2, :cond_0

    .line 1
    iput-wide p1, p0, Les/ve0;->e:J

    return-void

    .line 2
    :cond_0
    new-instance v0, Ljava/lang/IllegalArgumentException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Invalid connectionID "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public c(Les/tp0;)Les/up0;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-static {p1}, Les/ve0;->g(Les/tp0;)V

    .line 2
    invoke-direct {p0}, Les/je0;->m()V

    .line 3
    new-instance v0, Les/he0;

    check-cast p1, Les/le0;

    invoke-direct {v0, p0, p1}, Les/he0;-><init>(Les/je0;Les/le0;)V

    iput-object v0, p0, Les/je0;->m:Les/ge0;

    return-object v0
.end method

.method public close()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    iget-object v0, p0, Les/je0;->m:Les/ge0;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Les/ge0;->close()V

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Les/je0;->m:Les/ge0;

    .line 4
    :cond_0
    invoke-super {p0}, Les/ve0;->close()V

    return-void
.end method

.method public d()Les/tp0;
    .locals 1

    .line 1
    invoke-static {}, Les/ve0;->k()Les/tp0;

    move-result-object v0

    return-object v0
.end method

.method public d(Les/tp0;)Les/tp0;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    .line 2
    invoke-direct {p0, p1, v0}, Les/je0;->b(Les/tp0;Z)Les/tp0;

    move-result-object p1

    return-object p1
.end method

.method public e(Les/tp0;)Les/up0;
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-static {p1}, Les/ve0;->g(Les/tp0;)V

    .line 2
    invoke-direct {p0}, Les/je0;->m()V

    .line 3
    new-instance v0, Les/ie0;

    check-cast p1, Les/le0;

    invoke-direct {v0, p0, p1}, Les/ie0;-><init>(Les/je0;Les/le0;)V

    iput-object v0, p0, Les/je0;->m:Les/ge0;

    return-object v0
.end method

.method public f(Les/tp0;)Les/tp0;
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-static {p1}, Les/ve0;->g(Les/tp0;)V

    .line 2
    invoke-direct {p0}, Les/je0;->m()V

    .line 3
    iget-boolean v0, p0, Les/ve0;->a:Z

    if-eqz v0, :cond_1

    const/16 v0, 0x81

    .line 4
    check-cast p1, Les/le0;

    invoke-virtual {p0, v0, p1}, Les/ve0;->a(ILes/le0;)V

    .line 5
    invoke-virtual {p0}, Les/ve0;->j()[B

    move-result-object p1

    const/4 v0, 0x0

    .line 6
    iput-boolean v0, p0, Les/ve0;->a:Z

    .line 7
    iget-object v1, p0, Les/je0;->m:Les/ge0;

    if-eqz v1, :cond_0

    .line 8
    invoke-virtual {v1}, Les/ge0;->close()V

    const/4 v1, 0x0

    .line 9
    iput-object v1, p0, Les/je0;->m:Les/ge0;

    .line 10
    :cond_0
    aget-byte v0, p1, v0

    const/4 v1, 0x3

    invoke-static {v0, p1, v1}, Les/le0;->a(B[BI)Les/le0;

    move-result-object p1

    return-object p1

    .line 11
    :cond_1
    new-instance p1, Ljava/io/IOException;

    const-string v0, "Session not connected"

    invoke-direct {p1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1
.end method
